package java面向对象.内部类.匿名内部类;

public class Text {
    public static void main(String[] args) {
         show(new InterAnimal() {
             String name="小黑";
             public void shout() {
                 System.out.println(name+"汪汪汪");
             }

         });
    }
    public static void show(InterAnimal animal) {
        animal.shout();
    }
}

interface InterAnimal {
    void shout();
}
